package com.example.calcitedemo;

import org.apache.calcite.sql.*;
import org.apache.calcite.sql.util.SqlVisitor;

import javax.annotation.Nullable;

public abstract class SqlBasicVisitor<R> implements SqlVisitor<R> {
    //~ Methods ----------------------------------------------------------------

    @Override public R visit(SqlLiteral literal) {
        return null;
    }

    @Override public R visit(SqlCall call) {
        return call.getOperator().acceptCall(this, call);
    }

    @Override public R visit(SqlNodeList nodeList) {
        R result = null;
        for (int i = 0; i < nodeList.size(); i++) {
            SqlNode node = nodeList.get(i);
            result = node.accept(this);
        }
        return result;
    }

    @Override public R visit(SqlIdentifier id) {
        return null;
    }

    @Override public R visit(SqlDataTypeSpec type) {
        return null;
    }

    @Override public R visit(SqlDynamicParam param) {
        return null;
    }

    @Override public R visit(SqlIntervalQualifier intervalQualifier) {
        return null;
    }
}
